package com.hh.common;

import lombok.Getter;

/**
 * @author hanhui
 */
@Getter
public enum ErrorCode {
    //    通用
    SUCCESS(0, "ok", ""),
    PARAMS_ERROR(40000, "请求参数错误", ""),
    PARAMS_NULL(40002, "请求参数为空", ""),
    DATA_NULL_ERROR(40001, "请求数据为空", ""),
    STATUS_ERROR(30000, "账号异常", ""),
    NOT_LOGIN_ERROR(40100, "未登录", ""),
    NO_AUTH_ERROR(40101, "无权限", ""),
    SYSTEM_ERROR(50000, "系统内部异常", ""),

    OPERATION_ERROR(50001, "操作失败",""),
    //用户相关
    USER_NOT_FOUND(10001, "用户名或密码错误", "未找到对应的用户"),
    USER_ALREADY_EXISTS(10002, "用户已存在", "该用户名或其他唯一标识已被使用"),
    INCORRECT_PASSWORD(10003, "密码错误", "用户登录时输入的密码不正确"),
    ACCOUNT_DISABLE(10004, "该账号已禁用", "尝试登录的用户账户已被禁用，无法正常使用"),
    FILE_NOT_FOUND(40400, "资源不存在", ""),

    PASSWORD_CONFIRM_ERROR(10033, "两次密码输入不一致", ""),

    // 文章相关
    ARTICLE_NOT_FOUND(10001, "文章未找到", "未找到对应的文章"),
    // 公告相关
    NOTICE_NOT_FOUND(20001, "公告未找到", "未找到对应的公告"),
    NOTICE_TITLE_NULL(20002, "公告标题为空", "公告标题不能为空"),
    NOTICE_CONTENT_NULL(20003, "公告内容为空", "公告内容不能为空"),
    NOTICE_CREATE_ERROR(20004, "公告创建失败", "创建公告时发生错误"),
    NOTICE_UPDATE_ERROR(20005, "公告更新失败", "更新公告时发生错误"),
    NOTICE_DELETE_ERROR(20006, "公告删除失败", "删除公告时发生错误")
    ;

    private final int code;
    private final String message;
    private final String description;

    ErrorCode(int code, String message, String description) {
        this.code = code;
        this.message = message;
        this.description = description;
    }
}
